/*
 * @Author: scopesang
 * @Date: 2022-03-09 16:05:25
 * @LastEditors: scopesang
 * @LastEditTime: 2022-03-10 17:42:30
 * @FilePath: \reactts\src\project-list\search-panel.jsx
 * @Description:
 *
 * Copyright (c) 2022 by scopesang/大鹏科技, All Rights Reserved.
 */

import React, { useEffect, useState } from 'react'
export function SearchPanel() {
    const [param, setParam] = useState({
        name: '',
        personId: ''
    })
    // 用户列表
    const [user, setList] = useState([])
    // param 变化的时候 该生效的操作  (回调,依赖([param]代表什么时候生效 ))
    useEffect(() => {
        // 描写获取项目接口
        fetch('').then(async (res) => {
            if (res.ok) {
                console.log("");
            }
        })
    }, [param])

    return (
        <form>
            {/* setParam({},param,{ name:evt.target.value})  */}
            <input
                type="text"
                value={param.name}
                onChange={(evt) =>
                    setParam({
                        ...param,
                        name: evt.target.value
                    })
                }
            />

            <select
                value={param.personId}
                onChange={(evt) =>
                    setParam({
                        ...param,
                        personId: evt.target.value
                    })
                }>
                <option value="">负责 人</option>
                {/* option userList */}
                {users.map((item) => {
                    return <option value={item.personId}>{item.name}</option>
                })}
            </select>
        </form>
    )
}
